﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace MyEngineExercise.工作.兴宁出图_20121110
{
    public partial class inputForm : Form
    {
        public string str1 = "镇权属区路径";
        public string str2 = "界址点线数据库路径";
        public string str3 = "输出路径";


        public inputForm()
        {
            InitializeComponent();

            label6.Text = str1;
            label8.Text = str2;
            label9.Text = str3;

        }

        private void buttonCancle_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.Cancel;
            this.Close();
        }

        private void buttonConfirm_Click(object sender, EventArgs e)
        {
            if(textBox_searchMan.Text == string.Empty)
            {
                MessageBox.Show("调查员不能为空","提示",MessageBoxButtons.OK,MessageBoxIcon.Error);
                return;
            }
            if (textBox_makeMan.Text == string.Empty)
            {
                MessageBox.Show("制图员不能为空", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            if (textBox_checkMan.Text == string.Empty)
            {
                MessageBox.Show("审核员不能为空", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            if (textBox_qsq.Text == string.Empty)
            {
                MessageBox.Show(str1 + "不能为空", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            if (textBox_jz.Text == string.Empty)
            {
                MessageBox.Show(str2+"不能为空", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            if (textBox_output.Text == string.Empty)
            {
                MessageBox.Show(str3 + "不能为空", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }


            //判断路径或文件是否存在
            if (System.IO.Path.GetExtension(textBox_modual.Text) != ".txt")//textBox_modual.Text
            {
                //MessageBox.Show(str3 + "不能为空", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

            //写入应用程序设置

        }



        private void button_open_modual_Click(object sender, EventArgs e)
        {
            OpenFileDialog openfi = new OpenFileDialog();
            openfi.Filter = "txt文件|*.txt";//"shp文件|*.shp"

            if (openfi.ShowDialog() == DialogResult.OK)
            {
                textBox_modual.Text = openfi.FileName;
            }
        }

        private void button_open_qsq_Click(object sender, EventArgs e)
        {
            OpenFileDialog openfi = new OpenFileDialog();
            openfi.Filter = "shp文件|*.shp";//"shp文件|*.shp"

            if (openfi.ShowDialog() == DialogResult.OK)
            {
                textBox_qsq.Text = openfi.FileName;
            }
        }

        private void button_open_jz_Click(object sender, EventArgs e)
        {
            OpenFileDialog openfi = new OpenFileDialog();
            openfi.Filter = "mdb文件|*.mdb";//"shp文件|*.shp"

            if (openfi.ShowDialog() == DialogResult.OK)
            {
                textBox_jz.Text = openfi.FileName;
            }
        }

        private void button_open_output_Click(object sender, EventArgs e)
        {
            FolderBrowserDialog folderBrowserDialog = new FolderBrowserDialog();
            if (folderBrowserDialog.ShowDialog() == DialogResult.OK)
            {
                textBox_output.Text = folderBrowserDialog.SelectedPath;
            }
        }

    }
}
